package com.anzia.study_3;

import com.anzia.study_3.utils.UIUtils;
import ohos.aafwk.ability.Ability;
import ohos.aafwk.content.Intent;
import ohos.rpc.IRemoteObject;
import ohos.hiviewdfx.HiLog;
import ohos.hiviewdfx.HiLogLabel;

public class LocalServiceAbility extends Ability {
	private static final HiLogLabel LABEL_LOG = new HiLogLabel(HiLog.LOG_APP, 0xD001001, "LocalServiceAbility");

	@Override
	public void onStart(Intent intent) {
		HiLog.info(LABEL_LOG, "========LocalServiceAbility::onStart");
		super.onStart(intent);
	}

	@Override
	public void onBackground() {
		super.onBackground();
		HiLog.info(LABEL_LOG, "========LocalServiceAbility::onBackground");
	}

	@Override
	public void onStop() {
		super.onStop();
		HiLog.info(LABEL_LOG, "========LocalServiceAbility::onStop");
	}

	@Override
	public void onCommand(Intent intent, boolean restart, int startId) {
		// restart：ability启动的方式，true：ability是销毁后的重启，false：正常重启
		// startId：计数器，onCommand被调用一次，累加1
		UIUtils.showTip(this, "onCommand:" + restart + "," + startId);
	}

	@Override
	public IRemoteObject onConnect(Intent intent) {
		return null;
	}

	@Override
	public void onDisconnect(Intent intent) {
	}
}